package ace.module.account.core.impl.api.impl;

import ace.cmp.core.model.R;
import ace.module.account.api.IamApplicationConfigApi;
import ace.module.account.api.model.config.IamAccountBaseConfig;
import ace.module.account.api.model.dto.IamApplicationConfigDto;
import ace.module.account.core.impl.dao.entity.IamApplicationConfig;
import ace.module.account.core.impl.manager.IamApplicationConfigManager;
import ace.module.account.core.impl.service.IamAccountConfigService;
import ace.module.common.api.annotation.ApiLocalPriority;
import ace.module.common.core.impl.api.impl.SdkApiImpl;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component;


/**
 * 账户应用配置 api implements.
 *
 * @author Caspar
 *
 */
@ApiLocalPriority
@AllArgsConstructor
@Component
public class IamApplicationConfigApiImpl
    extends SdkApiImpl<IamApplicationConfig, Long, IamApplicationConfigDto, IamApplicationConfigManager>
    implements IamApplicationConfigApi {

  private final IamAccountConfigService accountConfigService;

  @Override
  public R<IamAccountBaseConfig> getBaseConfig(Long appBizTypeId) {
    IamAccountBaseConfig baseConfig = this.accountConfigService.getBaseConfig(appBizTypeId);
    return R.ok(baseConfig);
  }
}
